package com.example.dataSource;


import com.example.utils.DataSourceContextHolder;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * com.example.dataSource.DynamicDataSource
 *
 * @author ZRS
 * @version V1.0
 * @since 2025/10/30 22:09
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    /**
     * 确定当前使用的数据源
     */
    @Override
    protected Object determineCurrentLookupKey() {
        return DataSourceContextHolder.getDataSourceType();
    }
}
